var _getBaseDate = {
    //品牌
    getCarBrandList:function(callback){
        $.post($apiAddress.getBrandList,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            if(callback && typeof callback == 'function'){
                callback(res.result);
            }
        })
    },
    //分组品牌
    getGroupBrandList:function(callback,letter){
        $.post($apiAddress.getGroupBrandList,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            if(callback && typeof callback == 'function'){
                callback(res.result,letter);
            }
            clientCommon.setSession('groupBrandList',res.result);
        })
    },
    //车辆基础信息
    getCarBaseParam:function(callback){
        $.post($apiAddress.getCarBaseParam,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            if(callback && typeof callback == 'function'){
                callback(res.result);
            }
        })
    },
    //车身类型
    getCarTypeList:function(callback){
        $.post($apiAddress.getCarTypeList,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            if(callback && typeof callback == 'function'){
                callback(res.result);
            }
        })
    },
    //里程
    getCarMileageList:function (callback) {
        $.post($apiAddress.getCarMileageList,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            var list = res.result.splice(0,4);
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    //车龄
    getCarAgeList:function (callback) {
        $.post($apiAddress.getCarAgeList,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            var list = res.result.splice(0,4);
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    //车辆价格
    getPriceList:function (callback) {
        $.post($apiAddress.getPriceList,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    //车系
    getSeriesList:function (callback,data) {
        $.post($apiAddress.getSeriesList,data,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    //颜色
    getColorList:function(callback){
        $.get($apiAddress.getColorList,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    //省份
    getProvinceList:function(callback){
        $.post($apiAddress.getProvinceList,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    //城市
    getCityList:function(callback,data){
        $.post($apiAddress.getCityList,data,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            console.log(res);
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },

    //车辆列表
    getCarList:function (callback1,data,callback2) {
        layer.load('加载中',{
            shade: [0.1,'#000']
        });
        $.get($apiAddress.getCarList,data,function (res) {
            layer.closeAll('loading');
            if(typeof res != 'object') res = JSON.parse(res);
            if(callback1 && typeof callback1 == 'function'){
                callback1(res.result);
            }
            if(callback2 && typeof callback2 == 'function'){
                callback2(res.result);
            }
        })
    },
    //获取车辆列表数量
    getCarListNumber:function (callback,data) {
        $.post($apiAddress.getCarNum,data,function (res) {
            if(typeof res != 'object') res = JSON.parse(res);
            if(callback && typeof callback == 'function'){
                callback(res.result.total);
            }
        })
    },
    // 查询车辆配置
    getModelConfById: function (callback, data) {
        $.get($apiAddress.getModelConfById, data, function (res) {
            if (typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    // 查询车辆配置
    getCarConfById: function (callback, data) {
        $.get($apiAddress.getCarConfById, data, function (res) {
            if (typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    getCarById: function (callback, data) {
        $.get($apiAddress.getCarById, data, function (res) {
            if (typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })
    },
    gussYouLike: function (callback, data) {
        $.get($apiAddress.gussYouLike, data, function (res) {
            if (typeof res != 'object') res = JSON.parse(res);
            var list = res.result;
            // console.log(list, '猜你喜欢');
            if(callback && typeof callback == 'function'){
                callback(list);
            }
        })

    },



};